//
//  TextFieldCell.m
//  Maintenance
//
//  Created by tox on 2017/9/16.
//  Copyright © 2017年 com.kaopudian. All rights reserved.
//

#import "TextFieldCell.h"

@interface TextFieldCell ()

@end
@implementation TextFieldCell

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.userInteractionEnabled = YES;
        self.accessoryView = nil;
        self.editingAccessoryView = nil;
        self.shouldIndentWhileEditing = NO;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (void)awakeFromNib{
    [super awakeFromNib];
    [self.textField addTarget:self action:@selector(textFieldChange:) forControlEvents:UIControlEventEditingChanged];
}
- (void)textFieldChange:(UITextField *)textField{
    if (self.textFieldBlock) {
        self.textFieldBlock(textField);
    }
    
}
+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellID = @"TextFieldCell";
    TextFieldCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[NSBundle mainBundle]loadNibNamed:cellID owner:self options:nil].lastObject;
    }
    return cell;
}




@end
